# Author: Sanmu
# CreatTime: 2024/10/19
# Descriptior: 日志配置
import logging.config
import pathlib


def get_logger():
    file_path = pathlib.Path(__file__)
    dir_path = file_path.parents[0].resolve()
    # 日志配置文件
    file = dir_path / 'log_confing.ini'
    # 基于配置文件实现对日志的配置
    logging.config.fileConfig(file, encoding='utf-8')
    # 生成日志记录器
    logger = logging.getLogger()
    return logger